package com.six.work.servicesImpl;

import com.six.work.entity.*;
import com.six.work.mapper.InvitationMapper;
import com.six.work.mapper.PositionMapper;
import com.six.work.services.PositionServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PositionServicesImpl implements PositionServices {
    @Autowired
    private PositionMapper positionMapper;

    @Override
    public List<Position> findAllPosition() {
        List<Position> list = positionMapper.findAllPosition();
        return list;
    }

    @Override
    public List<Position> findPositionAndCompany(){
        List<Position> list=positionMapper.findPositionAndCompany();
        return list;
    }

    @Override
    public List<Position> findPositionAndCompany1(){
        List<Position> list = positionMapper.findPositionAndCompany1();
        return list;
    }

    @Override
    public List<CompanyAndPositionView> findPositionAndCompany2(){
        List<CompanyAndPositionView> list = positionMapper.findPositionAndCompany2();
        return list;
    }


    @Override
    public List<PositionView> finPositionByStateAndcomName(String positionName, Integer state_id) {
        return positionMapper.finPositionByStateAndcomName(positionName,state_id);
    }

    @Override
    public List<PositionView> findPositionByName(String positionName) {
        return positionMapper.findPositionByName(positionName);
    }

    @Override
    public String updatePositionState(Integer position_id) {
        return positionMapper.updatePositionState(position_id);
    }

    @Override
    public String updatePositionState1(Integer position_id) {
        return positionMapper.updatePositionState1(position_id);
    }

    @Override
    public Position SelectPositionByID(Integer position_id) {
        return positionMapper.SelectPositionByID(position_id);
    }



    //前端连数据库
    @Override
    public List<Position> findAllPosition1() {
        List<Position> list = positionMapper.findAllPosition1();
        return list;
    }

    //按工作地点查询
    @Override
    public List<Position> findPositionByAdd(String job_add) {
        return positionMapper.findPositionByAdd(job_add);
    }

    //按细分方向查询
    @Override
    public List<Position> findPositionByType(String job_type) {
        return positionMapper.findPositionByType(job_type);
    }

    //按薪资查询
    @Override
    public List<Position> findPositionByPay(String job_pay) {
        return positionMapper.findPositionByPay(job_pay);
    }

    //发布职位
    @Override
    public List<Position> findAllPositions() {
        List<Position> list = positionMapper.findAllPositions();

        return list;
    }

    @Override
    public Integer insertPosition(Position position) {

        return positionMapper.insertPosition(position);
    }

    @Override
    public List<Position> findComJobType(){
        List<Position>  list = positionMapper.findComJobType();
        return list;
    }

    @Override
    public List<CompanyState> findSuccessCom() {
        List<CompanyState> list = positionMapper.findSuccessCom();
        return list;
    }


    //前端页面间Aworkposition传值到positionItem(试)
    @Override
    public List<CompanyAndPositionView> SelectPositionByID2(Integer position_id) {
        return positionMapper.SelectPositionByID2(position_id);
    }

    //11--13
    @Override
    public List<Position> SelectPositionByID3(Integer company_id) {
        return positionMapper.SelectPositionByID3(company_id);
    }

    //今日新增
    @Override
    public Integer FindTodayCom() {
        return positionMapper.FindTodayCom();
    }

    @Override
    public Integer FindMonthCom() {
        return positionMapper.FindMonthCom();
    }

    //职位 饼图
    @Override
    public List<Position> sumJobType(){
        return positionMapper.sumJobType();
    }

    //热门投递职位top 10
    @Override
    public List<Position> jobTop10(){
        return positionMapper.jobTop10();
    }


    //查看公司发布的职位
    @Override
    public List<Position> ComPosition(Integer company_id) {
        return positionMapper.ComPosition(company_id);
    }

    @Override
    public Integer DelPositionByID(Integer position_id){
        return positionMapper.DelPositionByID(position_id);
    }
}
